home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1993 / MacHack 1993.toast / MacHack™ 1987-1992 / MacHack™ '90 / Utilities ƒ / MPW Tools ƒ / Simula4.07 / Simula 4.07ƒ / SInterfaces / macToolConst.sim < prev    next >
Encoding:
Text File  |  1989-05-01  |  6.9 KB  |  331 lines  |  [TEXT/MPS ]

  1. % ---------------------------------------------------------------------------
  2. %    Class MacToolConst.sim
  3. % Part of the interface to Macintosh Toolbox
  4. % This file contains the constant definitions from ToolIntf.p
  5. % and some of the constants in OSintf.p.
  6. % It is used as parameters to Toolbox routines of most "Tools".
  7. %
  8. % 890409/Boris Magnusson
  9. % Note: Is there a need to split this file in parts ?
  10. % ---------------------------------------------------------------------------
  11. class macToolConst;
  12. begin
  13. ! -- Thise comes from OSIntf.p ------------ ;
  14. short integer 
  15. !for Event Manager;
  16. everyEvent = -1,
  17. NullEvent = 0,
  18. mouseDown = 1,
  19. mouseUp = 2,
  20. keyDown = 3,
  21. keyUp = 4,
  22. autoKey = 5,
  23. updateEvt = 6,
  24. diskEvt = 7,
  25. activateEvt = 8,
  26. networkEvt = 10,
  27. driverEvt = 11,
  28. app1Evt = 12,
  29. app2Evt = 13,
  30. app3Evt = 14,
  31. app4Evt = 15,
  32.  
  33. ! event mask equates ;
  34. mDownMask = 2,
  35. mUpMask = 4,
  36. keyDownMask = 8,
  37. keyUpMask = 16,
  38. autoKeyMask = 32,
  39. updateMask = 64,
  40. diskMask = 128,
  41. activMask = 256,
  42. networkMask = 1024,
  43. driverMask = 2048,
  44. app1Mask = 4096,
  45. app2Mask = 8192,
  46. app3Mask = 16384,
  47. app4Mask = -32768;
  48.  
  49. !to decipher event message for keyDown events;
  50. integer 
  51. charCodeMask = 16RFF,     !$000000FF;
  52. keyCodeMask =  16RFF00,   !$0000FF00;
  53. adbAddrMask =  16RFF0000; !$00FF0000;
  54.  
  55. ! modifiers ;
  56. short integer 
  57. controlKey = 4096, ! Bit 4 of high byte ;
  58. optionKey  = 2048, ! Bit 3 of high byte ;
  59. alphaLock  = 1024, ! Bit 2 ;
  60. shiftKey   = 512,  ! Bit 1 ;
  61. cmdKey     = 256,  ! Bit 0 ;
  62. btnState   = 128,  ! Bit 7 of low byte is mouse button state ;
  63.  
  64. activeFlag = 1, ! bit 0 of modifiers for activate event ;
  65.  
  66. !error for PostEvent;
  67. evtNotEnb = 1;
  68.  
  69. ! --------- These comes from ToolIntf.p ------- ;
  70. Short integer 
  71.  
  72.     commandMark = 16R11, !$11;
  73.     checkMark     = 16R12, !$12;
  74.     diamondMark = 16R13, !$13;
  75.     appleMark     = 16R14, !$14;
  76.  
  77.     systemFont = 0,
  78.     applFont = 1,
  79.     newYork = 2,
  80.     geneva = 3,
  81.     monaco = 4,
  82.     venice = 5,
  83.     london = 6,
  84.     athens = 7,
  85.     sanFran = 8,
  86.     toronto = 9,
  87.     cairo = 11,
  88.     losAngeles = 12,
  89.     times = 20,
  90.     helvetica = 21,
  91.     courier = 22,
  92.     symbol = 23,
  93.     mobile = 24;
  94. Integer 
  95.     propFont     = 16R9000, ! $9000;
  96.     prpFntH         = 16R9001, ! $9001;
  97.     prpFntW         = 16R9002, ! $9002;
  98.     prpFntHW        = 16R9003, ! $9003;
  99.  
  100.     fixedFont     = 16RB000, ! $B000;
  101.     fxdFntH         = 16RB001, ! $B001;
  102.     fxdFntW         = 16RB002, ! $B002;
  103.     fxdFntHW     = 16RB003, ! $B003;
  104.  
  105.     fontWid         = 16RACB0; ! $ACB0;
  106.  
  107.     !for Window Manager;
  108.  
  109.     !window messages;
  110. short integer
  111.     wDraw = 0,
  112.     wHit = 1,
  113.     wCalcRgns = 2,
  114.     wNew = 3,
  115.     wDispose = 4,
  116.     wGrow = 5,
  117.     wDrawGIcon = 6,
  118.  
  119.     !types of windows;
  120.     dialogKind = 2,
  121.     userKind = 8,
  122.  
  123.     !desk pattern resource ID;
  124.     deskPatID = 16,
  125.  
  126.     !window definition PROCEDURE IDs;
  127.     documentProc = 0,
  128.     dBoxProc = 1,
  129.     plainDBox = 2,
  130.     altDBoxProc = 3,
  131.     noGrowDocProc = 4,
  132.     zoomDocProc = 8,
  133.     zoomNoGrow = 12,
  134.     rDocProc = 16,
  135.  
  136.     !FindWindow Result Codes;
  137.     inDesk = 0,
  138.     inMenuBar = 1,
  139.     inSysWindow = 2,
  140.     inContent = 3,
  141.     inDrag = 4,
  142.     inGrow = 5,
  143.     inGoAway = 6,
  144.  
  145.     !new 128K ROM;
  146.     inZoomIn = 7,
  147.     inZoomOut = 8,
  148.  
  149.     !defProc hit test codes;
  150.     wNoHit = 0,
  151.     wInContent = 1,
  152.     wInDrag = 2,
  153.     wInGrow = 3,
  154.     wInGoAway = 4,
  155.  
  156.     !new 128K ROM;
  157.     wInZoomIn = 5,
  158.     wInZoomOut = 6,
  159.  
  160.     !axis constraints for DragGrayRgn call;
  161.     noConstraint = 0,
  162.     hAxisOnly = 1,
  163.     vAxisOnly = 2,
  164.  
  165.     !for TextEdit;
  166.  
  167.     teJustLeft = 0,
  168.     teJustRight = - 1,
  169.     teJustCenter = 1,
  170.     teForceLeft = -2,     !for Arabic fonts, force left justification ;
  171.  
  172.     !for Resource Manager;
  173.  
  174.     !Resource attribute byte;
  175.     resSysHeap         = 64, ! System or application heap? ;
  176.     resPurgeable     = 32, ! Purgeable resource? ;
  177.     resLocked         = 16, ! Load it in locked? ;
  178.     resProtected     = 8,  ! Protected? ;
  179.     resPreload         = 4,  ! Load in on OpenResFile? ;
  180.     resChanged         = 2,  ! Resource changed? ;
  181.  
  182.     mapReadOnly     = 128,! Resource file read-only ;
  183.     mapCompact         = 64, ! Compact resource file ;
  184.     mapChanged         = 32, ! Write map out at update ;
  185.  
  186.     resNotFound     = -192, ! Resource not found ;
  187.     resFNotFound     = -193, ! Resource file not found ;
  188.     addResFailed     = -194, ! AddResource failed ;
  189.     rmvResFailed     = -196, ! RmveResource failed ;
  190.     rmvRefFailed     = -197, ! RmveReference failed ;
  191.     resAttrErr         = -198, ! attribute inconsistent with operation ;
  192.     mapReadErr         = -199, ! map inconsistent with operation ;
  193.  
  194.     !ID's for resources provided in sysResDef;
  195.  
  196.     !standard cursor definitions;
  197.     iBeamCursor = 1, !text selection cursor;
  198.     crossCursor = 2, !for drawing graphics;
  199.     plusCursor = 3,  !for structured selection;
  200.     watchCursor = 4, !for indicating a long delay;
  201.  
  202.     !icons;
  203.     stopIcon = 0,
  204.     noteIcon = 1,
  205.     cautionIcon = 2,
  206.  
  207.     !patterns;
  208.     sysPatListID = 0, !ID of PAT# which contains 38 patterns;
  209.  
  210.     !for Control Manager;
  211.  
  212.     !control messages;
  213.     drawCntl = 0,
  214.     testCntl = 1,
  215.     calcCRgns = 2,
  216.     initCntl = 3,
  217.     dispCntl = 4,
  218.     posCntl = 5,
  219.     thumbCntl = 6,
  220.     dragCntl = 7,
  221.     autoTrack = 8,
  222.  
  223.     !FindControl Result Codes;
  224.     inButton = 10,
  225.     inCheckbox = 11,
  226.     inUpButton = 20,
  227.     inDownButton = 21,
  228.     inPageUp = 22,
  229.     inPageDown = 23,
  230.     inThumb = 129,
  231.  
  232.     !control definition proc ID's;
  233.     pushButProc = 0,
  234.     checkBoxProc = 1,
  235.     radioButProc = 2,
  236.     scrollBarProc = 16,
  237.  
  238.     useWFont = 8,
  239.  
  240.     !for Dialog Manager;
  241.  
  242.     userItem = 0,
  243.     ctrlItem = 4,
  244.     btnCtrl = 0, ! Low two bits specify what kind of control ;
  245.     chkCtrl = 1,
  246.     radCtrl = 2,
  247.     resCtrl = 3,
  248.  
  249.     statText     = 8,   ! Static text ;
  250.     editText     = 16,  ! Editable text ;
  251.     iconItem        = 32,  ! Icon item ;
  252.     picItem         = 64,  ! Picture item ;
  253.     itemDisable = 128, ! Disable item if set ;
  254.  
  255.     ok = 1, ! OK button is first by convention ;
  256.     cancel = 2, ! Cancel button is second by convention ;
  257.  
  258.     !for Menu Manager;
  259.  
  260.     noMark = 0, ! mark symbol for MarkItem ;
  261.     textMenuProc = 0,
  262.  
  263.     ! menu defProc messages ;
  264.     mDrawMsg = 0,
  265.     mChooseMsg = 1,
  266.     mSizeMsg = 2,
  267.  
  268.     !for Scrap Manager;
  269.  
  270.     noScrapErr = - 100, !desk scrap isn't initialized;
  271.     noTypeErr = - 102,
  272.  
  273.     !package manager;
  274.     listMgr = 0, !list manager;
  275.     dskInit = 2, !Disk Initializaton;
  276.     stdFile = 3, !Standard File;
  277.     flPoint = 4, !Floating-Point Arithmetic;
  278.     trFunc  = 5, !Transcendental FUNCTIONs;
  279.     intUtil = 6, !International Utilities;
  280.     bdConv  = 7, !Binary/Decimal Conversion;
  281.  
  282.  
  283. !************** NEW TOOL CONSTANTS ************;                    
  284.  
  285. !Text Edit;
  286.  
  287. doFont    = 1,    ! set font (family) number    ;
  288. doFace    = 2,    ! set character style        ;
  289. doSize    = 4,    ! set type size             ;
  290. doColor     = 8,    ! set color                 ;
  291. doAll        = 15,    ! set all attributes        ;
  292. addSize     = 16,    ! adjust type size            ;
  293.         
  294. !Color Window Manager;
  295.  
  296.     !Window Part Identifiers which correlate color table
  297.         entries with window color table elements;
  298.  
  299. wContentColor    =        0,
  300. wFrameColor     =        1,
  301. wTextColor        =        2,
  302. wHiliteColor    =        3,
  303. wTitleBarColor    =        4,
  304.  
  305. !Color Control Manager;
  306.  
  307.     !Control Part Identifiers which correlate color table
  308.         entries with control color table elements;
  309.  
  310. cFrameColor     =     0,
  311. cBodyColor        =     1,
  312. cTextColor        =     2,
  313. cThumbColor     =     3,
  314.  
  315. !Menu Manager;
  316.  
  317. hMenuCmd        =    16R1B, !$1B;    !itemCmd == $1B ==> hierarchical menu;
  318. hierMenu        =    -1,        !a hierarchical menu - for InsertMenu call;
  319. mPopUpMsg        =    4,        ! menu defProc messages ;
  320. mctAllItems     =    -98,    ! search for all Items for the given ID ;
  321. mctLastIDIndic    =    -99,    ! last color table entry has this in ID field ;
  322.  
  323. ! Menu Manager Errors ;
  324.  
  325. dsMBarNFnd        =    85,
  326. dsHMenuFindErr    =    86
  327. ;
  328.  
  329. end -- Mac Tool Const -- ;
  330.